package com.matace.keychain.core.dataBaseBasic;

public final class DatabaseConstants {
    public static final String DATABASE_NAME = "MyUniversalDatabase.db"; // 数据库文件名
    public static final int DATABASE_VERSION = 1; // 数据库版本号

    // ==================== 表名和列名定义 ====================

    public static final String TABLE_USERS = "users"; // 用户表名
    public static final String COL_USER_ID = "_id"; // 用户ID列，推荐使用 _id 作为主键
    public static final String COL_USER_NAME = "name"; // 用户名列
    public static final String COL_USER_PASSWORD = "password"; // 用户密码列
    public static final String COL_USER_EMAIL = "email"; // 用户邮箱列

    // 定义创建用户表的 SQL 语句
    public static final String SQL_CREATE_USERS_TABLE =
            "CREATE TABLE " + TABLE_USERS + " (" +
                    COL_USER_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + // 自增主键
                    COL_USER_NAME + " TEXT NOT NULL UNIQUE," + // 用户名，不允许为空且唯一
                    COL_USER_PASSWORD + " TEXT NOT NULL," + // 密码，不允许为空
                    COL_USER_EMAIL + " TEXT UNIQUE)"; // 邮箱，唯一性

    // 如果有其他表，也可以在这里定义
    // public static final String TABLE_PRODUCTS = "products";
    // public static final String COL_PRODUCT_ID = "_id";
    // public static final String COL_PRODUCT_NAME = "product_name";
    // public static final String COL_PRODUCT_PRICE = "price";
    // public static final String SQL_CREATE_PRODUCTS_TABLE =
    //         "CREATE TABLE " + TABLE_PRODUCTS + " (" +
    //         COL_PRODUCT_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
    //         COL_PRODUCT_NAME + " TEXT NOT NULL," +
    //         COL_PRODUCT_PRICE + " REAL)";
}